import os,shutil,function

folder_path="Z:/系统/AI-开发/完成/0225-1"
if not os.path.exists("D:/Desk/0225-待上传"):
    os.mkdir("D:/Desk/0225-待上传")
filders=os.listdir(folder_path)
for folder in filders:
    folder_path2=folder_path+"/"+folder+"/C/"
    paths=function.get_file_paths(folder_path2)
    for path in paths:
        oc_id=path.split('/')[5].split("-")[0]
        designer=path.split('/')[5].split("-")[1]
        date=path.split('/')[4].split("-")[0]
        name=oc_id+"_"+designer+"_temu"+date+"_"+function.generate_random_string()+'.PNG'
        if '.png' in path or '.PNG' in path:
            try:
                shutil.copy(path,"D:/Desk/0225-待上传/"+name)
                print(f"✅{name}移动成功")
            except:
                print(f"❌{name}移动失败")